<template>
	<view class="review">
		<watermark></watermark>
		<view class="goods  zyjz f26 cl343 flex-start-c " v-for="(item,int) in items" :key="int">
			<image :src="item.img" mode="widthFix"></image>
			<view class="mgn-l-20" style="width:68%">
				<view class="omit1">
					{{item.goods_name}}
				</view>
				<view class="f24 mgn-t-30 mgn-b-40">{{item.num}}</view>
				<view class="f24 clAAA">借时间：{{item.borrows_time}}</view>
			</view>
		</view>
		<view class="" style="height: 200rpx;"></view>
		<view class="bottom zyjz pad-l-40 pad-t-20 pad-b-20 pad-r-20 bgfff f28 cl343">
			<button style="width: 100%;" type="primary" hover-class="none" @click="cancel">取消</button>
		</view>
		<uni-popup ref="alertDialog" type="dialog">
			<uni-popup-dialog type="info" cancelText="关闭" confirmText="确定" title="警告" content="确认取消？"
				@confirm="dialogConfirm"></uni-popup-dialog>
		</uni-popup>
	</view>
</template>

<script>
	import watermark from '@/components/watermark.vue'
	import mixins from '@/mixins/index.js'
	export default {
		mixins: [mixins],
		components: {
			watermark
		},
		data() {
			return {
				id: '',
				type: '',
				lists_url: 'borrows_goods',
				param: {
					page: 1,
					size: 100,
				},
				items: ''
			}
		},
		onLoad(e) {
			if (e && e.id) {
				this.id = e.id
				this.type = e.type
				this.param.orders_id = e.id
				this.get_lists();
			}
		},
		methods: {
			dialogConfirm() {
				this.api.post('cancel', {
					id: this.id
				}).then(res => {
					this.api.msg(res.msg)
					setTimeout(() => {
						this.back()
					}, 2000)
				})
			},
			cancel() {
				this.$refs.alertDialog.open()
			}
		}
	}
</script>

<style lang="less">
	.review {

		.goods {
			position: relative;
			padding: 20rpx 0;
			margin: 0 20rpx;
			border-bottom: 1px solid #f7f7f7;

			.out {
				position: absolute;
				top: 20rpx;
				left: 0rpx;

				image {
					width: 48rpx;
					height: 48rpx;
				}

				text {
					position: absolute;
					top: 10rpx;
					left: 5rpx;
				}
			}

			image {
				width: 200rpx;
				height: 150rpx;
			}

			.clff0 {
				color: #FF0000;
			}
		}
	}
</style>